package com.chen.recruit.domain;

import com.chen.recruit.common.enums.NoticeType;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 通知公告对象 t_notice
 *
 * @author cgy
 * @date 2022-08-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("Notice 通知公告对象")
public class Notice extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 公告ID
     */
    @ApiModelProperty("公告ID")
    @Null(message = "新增id必须为空", groups = AddGroup.class)
    @NotNull(message = "更新id不能为空", groups = UpdateGroup.class)
    private Integer id;

    /**
     * 公告标题
     */
    @ApiModelProperty("公告标题")
    @NotBlank(message = "标题不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String title;

    /**
     * 公告类型（0通知 1公告）
     */
    @ApiModelProperty("公告类型（0通知 1公告）")
    @NotNull(message = "类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private NoticeType type;

    /**
     * 公告内容
     */
    @ApiModelProperty("公告内容")
    private String content;

}
